<template>
	<view>
		<uni-nav-bar left-icon="arrowthinleft" title="我的收藏" :border="false" :fixed="true" bg="bg-fff" color="#333" @clickLeft="goBack()"></uni-nav-bar>
		
		<view class="radius-top30 padding-top-20 " >
			<view class="flex align-center justify-between flex-wrap padding-x-24">
				<view @click="jump('/pages/video/detail?id='+item.video_id)" v-for="(item,index) in list" :key='index' class="video_item relative radius10">
					<image :src="item.thumb" class="bg_img"></image>
					<view class="absolute padding-20 flex  justify-between flex-direction" style="width: 100%;height: 100%;top: 0;">
						<view class="flex align-center justify-end">
							<view class="flex align-center radius48" style="padding: 4rpx 8rpx;background: rgba(102, 102, 102, 0.2);">
								<image src="../../static/img/man.png" style="width: 26rpx;height: 26rpx;"></image>
								<text class="fs-22 color-fff">{{item.player}}</text>
							</view>
						</view>
						<view class="flex align-center">
							<image :src="item.avatar" style="width: 66rpx;height: 66rpx;border-radius: 100%;"></image>
							<view class="margin-left-20" style="width: 68%;">
								<view class="fs-26 color-fff opacity7">{{item.name}}</view>
								<!-- <view class="fs-22 color-fff opacity7 text-cut" style="margin-top: 6rpx;">没有人能随随便便成功！</view> -->
							</view>
						</view>
					</view>
				</view>
			</view>
			
			<view class="nomore" :class="loadStatus" v-if="list.length"></view>
			<empty v-if="list.length < 1"></empty>
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				q:{
					page:1
				},
				hasMore: true,
				loadStatus: '',
				list: [],
			}
		},
		onLoad() {
			this.getList()
		},
		onReachBottom() {
			if (this.hasMore) {
				this.q.page += 1;
				this.getList()
			}
		},
		methods:{
			// 推荐
			getList() {
				this.isLoading = true;
				this.$api.main_collect(this.q).then(res => {
					if (res.code == 1) {
						this.isLoading = false;
						this.list = [...this.list, ...res.data.data];
						if (res.data.data.length != 0) {
							this.hasMore = true;
							this.loadStatus = '';
						} else {
							this.hasMore = false;
							this.loadStatus = 'over';
						}
					}
				})
			},
		}
	}
</script>

<style>
	page{background: #F7F7F7;}
</style>
<style lang="scss" scoped>
	.video_item{width: 49%;margin-right: 2%;height: 470rpx;}
	.video_item:nth-child(2n+2){margin-right: 0;}
	.bg_img{
		width: 100%;
		height: 470rpx;
	}
</style>
